﻿@model Entidades.Sistema.Produccion.DiagramacionProduccion

@{
    Html.EnableClientValidation(); 
}


@using (Html.BeginForm("CambiaEstadoDiagramacionProduccionPartial", "DiagramacionProduccion", FormMethod.Post, new { @class = "edit_form" }))
{
    @Html.Hidden("IdDiagramacionProduccion")
    
    <div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
                settings.AssociatedControlName = "descrip";
                settings.Text = "Estado:";
            }
        ).GetHtml()
        @Html.DevExpress().ComboBox(
            settings => {
                settings.Name = "idEstado";
                settings.ControlStyle.CssClass = "editor";
                settings.Properties.TextField = "descrip";
                settings.Properties.ValueField = "idEstado";
                settings.Properties.ValueType = typeof(int);
            }
        ).BindList(ViewBag.EstadosDisponibles).Bind(Model.Estado.descrip).GetHtml()
        @Html.ValidationMessageFor(model => model.Estado.descrip, null, new { @class = "validator" })
    </div>
    
    <div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
                settings.Text = "Comentario:";
                settings.AssociatedControlName = "Comentario";
            }
        ).GetHtml()
        @Html.DevExpress().TextBox(
            settings => {
                settings.Name = "Comentario";
                settings.ControlStyle.CssClass = "editor";
            }
        ).Bind(Model.Comentario).GetHtml()
        @Html.ValidationMessageFor(model => model.Comentario, null, new { @class = "validator" })
    </div>
    <div class="line">
        @Html.DevExpress().Label(
            settings => {
                settings.ControlStyle.CssClass = "label";
            }
        ).GetHtml()
        @Html.DevExpress().Button(
            settings => {
                settings.Name = "btnUpdate";
                settings.ControlStyle.CssClass = "button";
                settings.Text = "Actualizar";
                settings.UseSubmitBehavior = true;
                settings.Enabled = ViewBag.PermiteGuardar;
            }
        ).GetHtml()
        @Html.DevExpress().Button(
            settings => {
                settings.Name = "btnCancel";
                settings.ControlStyle.CssClass = "button";
                settings.Text = "Cancelar";
                settings.ClientSideEvents.Click = "function(s, e){ document.location='" + DevExpressHelper.GetUrl(new { Controller = "DiagramacionProduccion", Action = "Index" }) + "'; }";
            }
        ).GetHtml()
    </div>
    <div class="line">
        <br />
        <h4>Bitácora de Estados:</h4>
    </div>    
        Html.RenderPartial("EstadosPartial", Model.Estados);
}

